<div class = "logcat-control">
  <table class="table">
    <tr>
      <td width="62">
        <button class="btn btn-default btn-sm btn-success transition noanimate" ng-show="!logCtrl.logcatState" ng-click="logCtrl.updateLogcatState()">开始</button>
        <button class="btn btn-default btn-sm btn-danger transition noanimate" ng-show="logCtrl.logcatState" ng-click="logCtrl.updateLogcatState()">停止</button>
      </td>
      <td width="80">
        <select class="form-control input-sm" ng-model="logCtrl.level" ng-change="logCtrl.changeLevel(logCtrl.level)">
          <option selected value="0">Info</option>
          <option value="1">Warn</option>
          <option value="2">Error</option>
        </select>
      </td>
      <td width="120"><input type="text" class="form-control input-sm" placeholder="time" ng-model="logCtrl.search.time" style="width: 100%;" /></td>
      <td width="80"><input type="text" class="form-control input-sm" placeholder="pid" ng-model="logCtrl.search.pid" style="width: 100%;" /></td>
      <td width="80"><input type="text" class="form-control input-sm" placeholder="tid" ng-model="logCtrl.search.tid" style="width: 100%;" /></td>
      <td width="100"><input type="text" class="form-control input-sm" placeholder="tag" ng-model="logCtrl.search.tag" style="width: 100%;" /></td>
      <td width="100"><input type="text" class="form-control input-sm" placeholder="text" ng-model="logCtrl.search.text" style="width: 100%;" /></td>
      <td width="62"><button class = 'btn btn-default btn-sm  transition logcat-clear' ng-click="logCtrl.clearLogcatState(logCtrl.logs)"><i class="fa fa-trash fa-2x"></i></button></td>
      <td width="62"><a class = 'btn btn-default btn-sm  transition logcat-save'
                        ng-if="logCtrl.isMac" ng-disabled="logCtrl.logcatState || logCtrl.logs.length == 0" ng-href="{{ logCtrl.url}}" download="{{ logCtrl.fileName}}.csv"><i class="fa fa-floppy-o fa-2x"></i></a></td>
      <td width="62"><button class = 'btn btn-default btn-sm  transition logcat-save'
                             ng-if="!logCtrl.isMac" ng-disabled="logCtrl.logcatState || logCtrl.logs.length == 0" ng-click="logCtrl.exportLogcatData(logCtrl.logs, logCtrl.level)"><i class="fa fa-floppy-o fa-2x"></i></button></td>
    </tr>
  </table>
</div>
<div class = "logcat-info">
  <table class="table">
    <tr ng-repeat="item in logCtrl.logs | filter:logCtrl.search" ng-class="{active: item.level=='I', warning: item.level=='W', danger: item.level=='E'}">
      <td>{{item.level}}</td>
      <td>{{item.time}}</td>
      <td>{{item.pid}}</td>
      <td>{{item.tid}}</td>
      <td>{{item.tag}}</td>
      <td>{{item.text}}</td>
    </tr>
  </table>
</div>
